/*
 * Metaverse Core
 * Copyright (C) 2010 Vyacheslav Vorobyov, All rights reserved.
 * See LICENSE for full license information.
 */
package org.metaverse.warehouse.com;



/**
 * @author vjache
 *
 */
public class Variable extends ValueConstraint {

	private String _name;

	/**
	 * @param aCode
	 */
	public Variable(String aName) {
		super(Code.VAR);
		_name = aName;
	}

	@Override
	public void visit(Visitor aVisitor) 
	{aVisitor.on(this);}

	/**
	 * @return the name
	 */
	public final String getName() 
	{return _name;}

	@Override
	public int hashCode() 
	{return _name.hashCode();}
	
	@Override
	public boolean equals(Object obj) 
	{
		if(this == obj)
			return true;
		
		if(!(obj instanceof Variable))
			return false;
		
		Variable v = (Variable)obj;
		
		return v._name.equals(_name);
	}
	
	@Override
	public String toString() 
	{return "?"+_name;}
}
